import React, { Component } from 'react'
import ContrilItem from '../ContrilItem/index'

class Input extends Component {

    setData = (e)  => {
        this.props.getData('name', e.target.value)
    }

    render() { 
        let { innerValue, label } = this.props
        return (
            <div>
                <span>{label}</span>
                <input defaultValue={innerValue} onChange={e => this.setData(e)} />
            </div>
        )
    }
}
 
export default ContrilItem({
    innerValue: '杨紫龙',
    label: '姓名'
})(Input)